package com.project.wxServer.domain.pay;

import com.project.common.annotation.Excel;
import com.project.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
 * 微信支付订单对象 t_order_record
 *
 * @author project
 * @date 2021-07-10
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TOrderRecord extends BaseEntity {

    private static final long serialVersionUID = -5712476620606365446L;

    /**
     * 主键
     */
    private Integer id;

    /**
     * 商品订单编号
     */
    @Excel(name = "商品订单编号")
    private String commodityId;

    /**
     * 商品类型
     */
    @Excel(name = "商品类型：1=直接支付")
    private Integer commodityType;

    /**
     * 用户编号
     */
    @Excel(name = "用户编号")
    private Long userId;

    /**
     * 支付方式
     */
    @Excel(name = "支付方式")
    private String paymentType;

    /**
     * 支付金额
     */
    @Excel(name = "支付金额")
    private BigDecimal paymentAmount;

    /**
     * 商品描述
     */
    @Excel(name = "商品描述")
    private String commodityDescrible;

    /**
     * 失败原因
     */
    @Excel(name = "失败原因")
    private String failCause;

    /**
     * 订单状态
     * 0.表示订单支付中
     * 1.表示订单支付完成
     * 2.表示订单支付失败
     */
    @Excel(name = "订单状态")
    private String orderStatus = "0";

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("commodityId", getCommodityId())
                .append("commodityType", getCommodityType())
                .append("userId", getUserId())
                .append("paymentType", getPaymentType())
                .append("paymentAmount", getPaymentAmount())
                .append("commodityDescrible", getCommodityDescrible())
                .append("failCause", getFailCause())
                .append("orderStatus", getOrderStatus())
                .toString();
    }
}
